/*
 Navicat Premium Data Transfer

 Source Server         : mysql5.6
 Source Server Type    : MySQL
 Source Server Version : 50631
 Source Host           : localhost:3306
 Source Schema         : myblog

 Target Server Type    : MySQL
 Target Server Version : 50631
 File Encoding         : 65001

 Date: 25/01/2019 15:17:31
*/

DROP DATABASE IF EXISTS myblog;
CREATE DATABASE myblog DEFAULT CHARACTER SET utf8;
USE myblog;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for article_info
-- ----------------------------
DROP TABLE IF EXISTS `article_info`;
CREATE TABLE `article_info` (
  `id` varchar(50) NOT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `category_id` varchar(50) DEFAULT NULL,
  `article_title` varchar(500) DEFAULT NULL,
  `article_content` varchar(4000) DEFAULT NULL,
  `article_img` varchar(1255) DEFAULT NULL,
  `article_recom` varchar(10) DEFAULT NULL,
  `article_time` datetime DEFAULT NULL,
  `article_mark` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of article_info
-- ----------------------------
BEGIN;
INSERT INTO `article_info` VALUES ('1', '1', '1', 'Java', 'Java', '程序员上班', '1', '2018-10-16 11:53:33', '1');
INSERT INTO `article_info` VALUES ('2', '1', '1', 'Java程序员上班', 'Java程序员上班', 'Java程序员上班', '1', '2018-10-16 11:54:27', '1');
INSERT INTO `article_info` VALUES ('3', '1', '1', 'Java程序员上班', 'Java程序员上班', 'Java程序员上班', '1', '2018-10-16 11:54:27', '1');
INSERT INTO `article_info` VALUES ('4', '1', '2', 'C++程序员上班', 'C++程序员上班', 'C++程序员上班', '1', '2018-10-16 11:54:27', '1');
INSERT INTO `article_info` VALUES ('5', '1', '3', 'PHP程序员上班', 'PHP程序员上班', 'PHP程序员上班', '1', '2018-10-16 11:54:27', '1');
COMMIT;

-- ----------------------------
-- Table structure for category_info
-- ----------------------------
DROP TABLE IF EXISTS `category_info`;
CREATE TABLE `category_info` (
  `id` varchar(50) NOT NULL,
  `category_name` varchar(255) DEFAULT NULL,
  `category_alias` varchar(255) DEFAULT NULL,
  `category_desc` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of category_info
-- ----------------------------
BEGIN;
INSERT INTO `category_info` VALUES ('1', 'Java', 'Java', 'Java程序员访问的社区');
INSERT INTO `category_info` VALUES ('2', 'C++', 'C++', 'C++程序员访问的社区');
INSERT INTO `category_info` VALUES ('3', 'PHP', 'PHP', 'PHP程序员访问的社区');
COMMIT;

-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
  `id` varchar(50) NOT NULL COMMENT '权限id',
  `name` varchar(50) NOT NULL COMMENT '资源名称',
  `permission_name` varchar(50) DEFAULT NULL COMMENT '权限名称',
  `url` varchar(50) NOT NULL COMMENT '资源url',
  `type` varchar(50) DEFAULT NULL COMMENT '资源类型：0：目录 1：菜单 2：按钮',
  `sort` varchar(50) DEFAULT NULL COMMENT '排序',
  `icon` varchar(50) DEFAULT NULL COMMENT '图标',
  `is_hide` varchar(50) DEFAULT NULL COMMENT '是否隐藏',
  `level` varchar(50) DEFAULT NULL COMMENT '节点在树的第几层',
  `parent_id` varchar(50) DEFAULT NULL COMMENT '父节点id',
  `node_id` varchar(50) DEFAULT NULL COMMENT '当前节点id',
  `checked` varchar(50) DEFAULT NULL COMMENT '是否选中',
  `target` varchar(50) DEFAULT NULL COMMENT '显示目标',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of permission
-- ----------------------------
BEGIN;
INSERT INTO `permission` VALUES ('1e65b2d03c7d44dcbb2138619713b8c4', '系统设置', NULL, '', '1', NULL, NULL, NULL, NULL, 'fa61b0363a6f40678d170064be01453b', NULL, 'false', '');
INSERT INTO `permission` VALUES ('28d2232a656f4336ace35367b47f8735', '留言管理', NULL, '/back/message/index', '1', NULL, NULL, NULL, NULL, 'fa61b0363a6f40678d170064be01453b', NULL, 'false', 'mainframe');
INSERT INTO `permission` VALUES ('54aa6c21100b48d6a2f48e9582764d6d', '菜单设置', NULL, '/back/sys/menu/index?page=1', '1', NULL, NULL, NULL, NULL, '1e65b2d03c7d44dcbb2138619713b8c4', NULL, 'false', 'mainframe');
INSERT INTO `permission` VALUES ('721825b8bbb6434bb6ce65eda00aeb84', '栏目管理', NULL, '/back/category/index?page=1', '1', NULL, NULL, NULL, NULL, 'fa61b0363a6f40678d170064be01453b', NULL, 'false', 'mainframe');
INSERT INTO `permission` VALUES ('af71e5b5d66340fd933dcba307626b44', '用户管理', NULL, '/back/user/index?page=1', '1', NULL, NULL, NULL, NULL, '1e65b2d03c7d44dcbb2138619713b8c4', NULL, 'false', 'mainframe');
INSERT INTO `permission` VALUES ('eac5da1c5405435d9b30716203467bc4', '角色设置', NULL, '/back/sys/role/index?page=1', '1', NULL, NULL, NULL, NULL, '1e65b2d03c7d44dcbb2138619713b8c4', NULL, 'false', 'mainframe');
INSERT INTO `permission` VALUES ('ee0b538278c840d2bbbfb70c4a57438e', '前端接口', NULL, 'http://localhost:9999/swagger-ui.html', '1', NULL, NULL, NULL, NULL, 'fa61b0363a6f40678d170064be01453b', NULL, NULL, 'mainframe');
INSERT INTO `permission` VALUES ('f6769d85a08c4c9c83ed97da821dc980', '文章管理', NULL, '/back/article/index', '1', NULL, NULL, NULL, NULL, 'fa61b0363a6f40678d170064be01453b', NULL, 'false', 'mainframe');
INSERT INTO `permission` VALUES ('fa61b0363a6f40678d170064be01453b', '功能菜单', NULL, '', '1', NULL, NULL, NULL, NULL, '0', NULL, 'false', '');
COMMIT;

-- ----------------------------
-- Table structure for permission_role
-- ----------------------------
DROP TABLE IF EXISTS `permission_role`;
CREATE TABLE `permission_role` (
  `permission_id` varchar(50) NOT NULL COMMENT '权限id',
  `role_id` varchar(50) NOT NULL DEFAULT '' COMMENT '角色id',
  PRIMARY KEY (`permission_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of permission_role
-- ----------------------------
BEGIN;
INSERT INTO `permission_role` VALUES ('1e65b2d03c7d44dcbb2138619713b8c4', '1');
INSERT INTO `permission_role` VALUES ('1e65b2d03c7d44dcbb2138619713b8c4', '3');
INSERT INTO `permission_role` VALUES ('28d2232a656f4336ace35367b47f8735', '1');
INSERT INTO `permission_role` VALUES ('28d2232a656f4336ace35367b47f8735', '3');
INSERT INTO `permission_role` VALUES ('54aa6c21100b48d6a2f48e9582764d6d', '3');
INSERT INTO `permission_role` VALUES ('721825b8bbb6434bb6ce65eda00aeb84', '1');
INSERT INTO `permission_role` VALUES ('721825b8bbb6434bb6ce65eda00aeb84', '3');
INSERT INTO `permission_role` VALUES ('af71e5b5d66340fd933dcba307626b44', '1');
INSERT INTO `permission_role` VALUES ('af71e5b5d66340fd933dcba307626b44', '3');
INSERT INTO `permission_role` VALUES ('eac5da1c5405435d9b30716203467bc4', '3');
INSERT INTO `permission_role` VALUES ('ee0b538278c840d2bbbfb70c4a57438e', '3');
INSERT INTO `permission_role` VALUES ('f6769d85a08c4c9c83ed97da821dc980', '1');
INSERT INTO `permission_role` VALUES ('f6769d85a08c4c9c83ed97da821dc980', '2');
INSERT INTO `permission_role` VALUES ('f6769d85a08c4c9c83ed97da821dc980', '3');
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` varchar(50) NOT NULL COMMENT '主键id',
  `role_name` varchar(255) DEFAULT NULL COMMENT '角色名称',
  `cname` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES ('1', 'admin', '管理员');
INSERT INTO `role` VALUES ('2', 'customer', '普通用户');
INSERT INTO `role` VALUES ('3', 'superAdmin', '超级管理员');
COMMIT;

-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
  `id` varchar(50) NOT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `user_account` varchar(50) DEFAULT NULL,
  `user_password` varchar(255) DEFAULT NULL,
  `user_mark` varchar(255) DEFAULT NULL,
  `user_phone` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_account_index` (`user_account`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user_info
-- ----------------------------
BEGIN;
INSERT INTO `user_info` VALUES ('1', '悟空', 'wukong', '123', '1', '18911783756');
INSERT INTO `user_info` VALUES ('10', '苍蓝星', 'clx', 'clx', '1', '88888888');
INSERT INTO `user_info` VALUES ('11', '作者', 'zz', 'zz', '1', '88888888');
INSERT INTO `user_info` VALUES ('12', '超级管理员', 'sadmin', 'sadmin', '1', '88888888');
INSERT INTO `user_info` VALUES ('2', '八戒', 'bajie', '123', '1', '189227364753');
INSERT INTO `user_info` VALUES ('3', '哈哈', 'haha', '123', '1', '189287374832');
INSERT INTO `user_info` VALUES ('4', '白龙', 'bailong', '123', '1', '178923232323');
INSERT INTO `user_info` VALUES ('5', '黑龙', 'heilong', '123', '1', '189232323234');
INSERT INTO `user_info` VALUES ('6', '小小', 'xiaoxiao', '123', '1', '1892235838438');
INSERT INTO `user_info` VALUES ('7', '唐僧', 'tangseng', '123', '1', '189212121212');
INSERT INTO `user_info` VALUES ('8', '啦啦啦', 'tangsen', '123', '1', '13213213123');
INSERT INTO `user_info` VALUES ('9', 'admin', 'admin', 'admin', '1', '12321');
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `user_id` varchar(50) NOT NULL COMMENT '用户id',
  `role_id` varchar(50) NOT NULL COMMENT '角色id',
  PRIMARY KEY (`user_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES ('12', '3');
INSERT INTO `user_role` VALUES ('2', '2');
INSERT INTO `user_role` VALUES ('3', '2');
INSERT INTO `user_role` VALUES ('4', '2');
INSERT INTO `user_role` VALUES ('5', '2');
INSERT INTO `user_role` VALUES ('9', '1');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
